<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统授权页面</title>
    <link th:href="@{/css/styles.css}" rel="stylesheet"/>
</head>
<body>
<div class="container">
    <div class="card">
        <h1>系统未授权</h1>
        <p>请在下方输入您的注册码以激活系统。</p>
        <form th:action="@{/submitLicense}" method="POST" th:object="${formData}">
            <div class="textarea-container">
                <label for="machineCode">机器码</label>
                <textarea id="machineCode" readonly th:text="${hardwareIdentifier}"></textarea>
                <button class="submit-btn copy-btn" type="button" onclick="copyMachineCode()">复制机器码</button>
            </div>
            <div class="textarea-container">
                <label for="licenseCode">请输入您的注册码</label>
                <textarea id="licenseCode" name="licenseCode" th:field="*{licenseCode}" class="license-code" placeholder="请输入您的注册码..."></textarea>
            </div>
            <div class="error-message" th:if="${message}">
                <p th:text="${message}"></p>
            </div>
            <button class="submit-btn" type="submit">提交授权</button>
        </form>
        <p class="instructions">复制机器码并联系我们，获取授权码。</p>
        <!-- 新增的公司联系信息 -->
        <div class="contact-info">
            <h3>联系我们</h3>
            <p>公司名称：南京朗赢信息技术有限公司</p>
            <p>邮箱：longwin@longwi.com</p>
            <p>电话：025-52850163</p>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery-3.7.1.min.js}"></script>
<script>
    function copyMachineCode() {
        const machineCode = $('#machineCode');
        machineCode.select();
        document.execCommand('copy');
        alert('机器码已复制，请联系我们！');
    }
</script>
</body>
</html>
